package Tracing;

import UI.Constants;
import UI.View;
import prefuse.data.Table;

public class FixEquationStack extends Table{

	public FixEquationStack(){
		super();
		addColumn("fixequation", String.class);
	}
	
	public void push(String equation){
		this.addRow();
		int rowCount = this.getRowCount();
		this.setString(rowCount-1,"fixequation",equation);
	}
	
	public String toString(){

		StringBuffer buf = new StringBuffer();
		buf.append("***************Fix-equations " + Constants.fixEquations + "***************");
		if(getRowCount()>0){
			for(int i = 0; i < getRowCount(); i++){
				buf.append("\n"+getString(i, "fixequation"));
			}	
		}else{
			buf.append(UI.Constants.empty);
		}
		buf.append("\n*********************************************");
        return buf.toString();
	}
	
	public void print(){
		System.out.println(this.toString());
	}
	
	public void print(View view){
		view.getProcessPanel().getTextArea().append(this.toString());
		
	}
}
